home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 25
/
Cream of the Crop 25.iso
/
faq
/
amsls497.zip
/
AMOSLIST
/
000129_amos-request@svcs1.digex.net_Wed Apr 16 12:39:14 1997.msg
< prev
next >
Wrap
Internet Message Format
|
1997-05-01
|
3KB
Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
by mail3.access.digex.net (8.8.5/8.8.5) with ESMTP id MAA19903
for <mcox@access.digex.net>; Wed, 16 Apr 1997 12:39:12 -0400 (EDT)
Received: (from daemon@localhost)
by svcs1.digex.net (8.8.5/8.8.5) id KAA27945
for amos-out; Wed, 16 Apr 1997 10:20:53 -0400 (EDT)
Received: from mail3.access.digex.net (mail3.access.digex.net [205.197.247.4])
by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id KAA27942
for <amos-list@svcs1.digex.net>; Wed, 16 Apr 1997 10:20:52 -0400 (EDT)
Received: from red.paston.co.uk (red.paston.co.uk [194.129.188.3])
by mail3.access.digex.net (8.8.5/8.8.5) with ESMTP id KAA01566
for <amos-list@access.digex.net>; Wed, 16 Apr 1997 10:20:50 -0400 (EDT)
Received: from paston.co.uk ([194.129.188.201]) by red.paston.co.uk with SMTP id <843313-141>; Wed, 16 Apr 1997 15:18:35 +0100
From: Ben Wyatt <bwyatt@paston.co.uk>
To: amos-list@access.digex.net
Date: Wed, 16 Apr 1997 00:17:15 -0000
Message-ID: <yam7045.792.3829552@194.129.188.3>
In-Reply-To: <861139415.0918137.0@h144.redrose.net>
X-Mailer: YAM 1.3.4 [020] - Amiga Mailer by Marcel Beck
Subject: Re: Line problems
MIME-Version: 1.0
Content-Type: text/plain
Status: O
X-Status:
On 15-Apr-97, Mush sat on a keyboard and produced this mess:
> >> OK, ill try and explain this problem again. Im making a perspective
> >> box/rectangle, so naturally, one end will be close, and the other end
> >> smaller, so simulate the depth of the box. Here is an example: (crap
> ASCII art)
> >>
> >> |
> >> |
> >> | |
> >> | |
> >> |
> >> |
> >Surely, if you have already drawn the vertical lines on screen, all the
> >necessary co-ords will be contained within the variables that set them?
> >
> >Or have I mis-understood?
> I know the top coords of the 2 lines drawn, but it is the top and bottom Y
> coordinates on the actual SLOPES that I need to know quickly
OK, I think I understand this problem now. Hopefully, this program
should solve your problem...
X1=10 : X2=95 : Rem Left and right edge x positions
YTOP1=30 : YTOP2=50 : Rem Top coordinates
YBOT1=150 : YBOT2=115 : Rem Bottom coordinates
' Draw verticle sides
Draw X1,YTOP1 To X1,YBOT1
Draw X2,YTOP2 To X2,YBOT2
' Get gradients of lines (*256 so it is int and power of 2 for speed)
GRADTOP=(256*(YTOP2-YTOP1))/(X2-X1)
GRADBOT=(256*(YBOT2-YBOT1))/(X2-X1)
For X=X1 To X2
' Get coordinates at current x position
YTOP=YTOP1+((X-X1)*GRADTOP)/256
YBOT=YBOT1+((X-X1)*GRADBOT)/256
' Plot the top and bottom points
Plot X,YTOP
Plot X,YBOT
Next X
Bye ____________________________________________________
/ \
/ Ben Wyatt - bwyatt@paston.co.uk or b.wyatt@uea.ac.uk \
\ http://www.paston.co.uk/users/bwyatt/index.html /
\____________________________________________________/
(c)1995-97 Very Interesting Signatures Ltd.